<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //   var arr = [10, 20, 80];
      function fn() {
        var min = arguments[0];
        for (i = 0; i < arguments.length; i++) {
          if (arguments[i] < min) {
            min = arguments[i];
          }
        }
        console.log(min);
        var max = arguments[0];
        for (i = 0; i < arguments.length; i++) {
          if (arguments[i] > max) {
            max = arguments[i];
          }
        }
        console.log(max);
        var mid = arguments[0];
        for (i = 0; i < arguments.length; i++) {
          if (arguments[i] < max && arguments[i] > min) {
            mid = arguments[i];
          }
        }
        console.log(mid);
      }
      fn(50, 60, 90);
    </script>
  </body>
</html>
